home *** CD-ROM | disk | FTP | other *** search
/ VRML 2.0 Sourcebook (2nd Edition) / VRML 2.0 Sourcebook CD [md5 fed90f4f9c39d5a60d477058775c7e21].iso / book / unix / ch19 / 19fig27.wrl < prev    next >
Text File  |  1996-09-23  |  1KB  |  54 lines

  1. #VRML V2.0 utf8
  2. # The VRML 2.0 Sourcebook
  3. # Copyright [1997] By
  4. # Andrea L. Ames, David R. Nadeau, and John L. Moreland
  5. Group {
  6.     children [
  7.     # Animated shape
  8.         Shape {
  9.             appearance Appearance {
  10.                 material Material { }
  11.             }
  12.             geometry IndexedFaceSet {
  13.                 coord Coordinate {
  14.                     point [
  15.                         -1.0 -1.0  0.0,   1.0 -1.0  0.0,
  16.                          1.0  1.0  0.0,  -1.0  1.0  0.0,
  17.                     ]
  18.                 }
  19.                 normal DEF AnimNorm Normal {
  20.                     vector [
  21.                         0.0  0.0  1.0,   0.0  0.0  1.0,
  22.                         0.0  0.0  1.0,   0.0  0.0  1.0,
  23.                     ]
  24.                 }
  25.                 coordIndex  [ 0, 1, 2, 3 ]
  26.                 normalIndex [ 0, 1, 2, 3 ]
  27.                 normalPerVertex TRUE
  28.             }
  29.         },
  30.     # Animation clock
  31.         DEF Clock TimeSensor {
  32.             cycleInterval 4.0
  33.             loop TRUE
  34.         },
  35.     # Animation normals
  36.         DEF NormPath NormalInterpolator {
  37.             key [ 0.0, 0.5, 1.0 ]
  38.             keyValue [
  39.             # time 0.0 normals
  40.                 0.0  0.0  1.0,   0.0  0.0  1.0,
  41.                 0.0  0.0  1.0,   0.0  0.0  1.0,
  42.             # time 0.5 normals
  43.                 0.0  0.0  1.0,   1.0  0.0  0.0,
  44.                 1.0  0.0  0.0,   0.0  0.0  1.0,
  45.             # time 1.0 normals
  46.                 0.0  0.0  1.0,   0.0  0.0  1.0,
  47.                 0.0  0.0  1.0,   0.0  0.0  1.0,
  48.             ]
  49.         }
  50.     ]
  51. }
  52. ROUTE Clock.fraction_changed TO NormPath.set_fraction
  53. ROUTE NormPath.value_changed TO AnimNorm.set_vector
  54.